﻿using System;
using System.Runtime.Serialization;
using Global.Interfaces.Server;

namespace Global.Impl.Server
{
    [DataContract]
    public class Buddy : IBuddy
    {
        #region IBuddy Members

        [DataMember]
        public string Username { get; set; }
        
        [DataMember]
        public string Ip { get; set; }
        
        [DataMember]
        public int Port { get; set; }

        [DataMember]
        public string PublicKey { get; set; }

        [DataMember]
        public bool IsOnline { get; set; }

        [DataMember]
        public DateTime LastActive { get; set; }

        #endregion

        public Buddy(string username, string ip, int port, string publicKey, bool isOnline)
        {
            this.Username = username;
            this.Ip = ip;
            this.Port = port;
            this.PublicKey = publicKey;
            this.IsOnline = isOnline;
            this.LastActive = DateTime.Now;
        }

       
    }
}
